<template>
	<view class="content">
		<nav-bars backState="1000" bgColor="#fff" fontColor="#333" title="管家团队"></nav-bars>
		<view class="wrapper">
			<view class="headeArea">
				<view class="columnOne flex align-items">
					<view class="h1-title">
						超级管家队伍
					</view>
					<button open-type="contact" class="customers">客服
						<!-- <view class="customers">客服</view> -->
					</button>
				</view>
				<view class="subtitle">
					您可以任意选择队伍进入展示页
				</view>
			</view>
			<view class="mainarea" v-if="list.length>0">
				<view class="itemBox flex align-items" v-for="(item,index) in list" :key="index" @click="goSkip('/pages_activity/pages/steward/product/index?steward_id='+item.id)">
					<view class="sidebara">
						<image :src="`${imageSrc}/static/activity/steward_icon.png`"></image>
					</view>
					<view class="sidebarb">
						<view class="title">
							{{item.name}}
						</view>
						<view class="subtitle">
							{{item.sub_title || ''}}
						</view>
					</view>
					<view class="sidebarc">
						进入
					</view>
				</view>
				<!-- <view class="itemBox flex align-items" @click="goSkip('/pages_activity/pages/steward/product/index')">
					<view class="sidebara">
						<image :src="`${imageSrc}/static/activity/steward_icon.png`"></image>
					</view>
					<view class="sidebarb">
						<view class="title">
							YYDS管家队
						</view>
						<view class="subtitle">
							北欧简约风家装套餐打包
						</view>
					</view>
					<view class="sidebarc">
						进入
					</view>
				</view> -->
				<u-loadmore :status="statusLoading" :icon-type="iconType" :load-text="loadText" />
			</view>
			<view class="notList" v-else>
				<image :src="`${imageSrc}/static/constr/notList.png`" mode=""></image>
				空空如也
			</view>
		</view>
	</view>
</template>

<script>
	import service_now from '@/service/now.js';
	export default {
		components: {
		},
		data() {
			return {
				statusLoading: 'loadmore',
				iconType: 'flower',
				loadText: {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '到底了~'
				},
				page: 1,
				pagesize: 10,
				imageSrc: this.$static,
				list: [],
			}
		},
		onLoad() {
			this.getstewardTeam()
		},
		methods:{
			goSkip(url){
				uni.navigateTo({
					url: url
				});
			},
			getstewardTeam(){
				let params = {
					page: this.page,
					pagesize: this.pagesize
				}
				this.statusLoading = 'loading'
				service_now.stewardTeam(params).then(res => {
					if (res.code == 1) {
						let data = res.data.stewards;
						let pages=this.page*this.pagesize
						if (pages>=res.data.total) {
							this.statusLoading = 'nomore'
						} else {
							this.statusLoading = 'loading'
						}
						this.list = this.list.concat(data)
					}
				})
			}
		},
		onReachBottom() {
			this.page++;
			if (this.statusLoading == 'loading') {
				this.getstewardTeam();
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		height: 100%;

		.wrapper {
			width: 100%;
			height: auto;
		}

		.headeArea {
			width: 94%;
			margin: auto;
			margin-top: 94rpx;
           button{
			   margin: 0 0 0 auto;
			   font-size: 28rpx;
			   outline: none;
		   }
			.columnOne {
				justify-content: space-between;

				.h1-title {
					color: #352000;
					font-size: 48rpx;
					font-weight: 800;
				}

				.customers {
					width: 114rpx;
					height: 44rpx;
					line-height: 44rpx;
					text-align: center;
					color: #FFFFFF;
					background: #F99704;
					box-shadow: 0px 3rpx 6rpx rgba(249, 151, 4, 0.2);
					border-radius: 23rpx;
				}
			}

			.subtitle {
				margin-top: 20rpx;
				color: #352000;
				font-weight: 500;
			}
		}

		.mainarea {
			width: 100%;
			margin-top: 84rpx;
			padding-bottom:40rpx;
			.itemBox{
				width: 92%;
				height: 150rpx;
				margin: auto;
				.sidebara {
					image {
						width: 72rpx;
						height: 72rpx;
					}
				}
				
				.sidebarb {
					margin-left:30rpx;
				
					.title {
						color: #2D261A;
						font-size: 32rpx;
						font-weight: bold;
					}
				
					.subtitle {
						color: #605B53;
						font-size: 22rpx;
						margin-top: 8rpx;
					}
				}
				
				.sidebarc {
					color: #8B672C;
					margin: 0 0 0 auto;
				}
			}
		}

		.flex {
			display: flex;
		}

		.align-items {
			align-items: center;
		}
		.notList {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			margin: auto;
			height: 400rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 426rpx;
		
			image {
				width: 426rpx;
				height: 356rpx;
				margin-bottom: 40rpx;
			}
		
			font:500 40rpx/56rpx PingFang SC;
			color: #333;
		}
	}
</style>
